﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LinkCard.Utils;

namespace LinkCard.AdminCP.Adv
{
    public partial class ad_active : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Int64 nAdID = ConvertUtility.ToInt64(Request.QueryString["ID"]);

            if (nAdID > 0)
            {
                string sSQL = "update ads set isActive = (Select [isActive] = CASE [isActive] WHEN 0 THEN 1 ELSE 0 END from ads where AdID =" + nAdID + ") where AdID =" + nAdID;
                DataHelper.ExecuteNonQuery(sSQL, true);
                Response.Redirect("/Adv/ad_list.aspx");
            }
        }
    }
}